package com.xnj.data_stream_demo;

import java.io.DataOutputStream;
import java.io.FileOutputStream;

// 数据输出流
public class Test1 {

    public static void main(String[] args) {
        try (
                DataOutputStream dos = new DataOutputStream(new FileOutputStream("src/data.txt"));
                ){

            dos.writeInt(99);
            dos.writeDouble(3.14);
            dos.writeBoolean(true);
            dos.writeUTF("你好");// utf-8

        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
